#!/bin/bash
echo "Building minimal AI system..."
echo

WXWIN="/d/vc/wxWidgets-3.2.7"

# 只编译 AI 通信系统，不依赖原有库
g++ -std=c++11 -O2 -Wall -Wextra \
    -I$WXWIN/include -I$WXWIN/include/msvc \
    -D__WXMSW__ -D_UNICODE -DUNICODE \
    src/ai_communication_protocol.cpp \
    src/human_ai_terminal.cpp \
    src/ai_computer_terminal.cpp \
    src/ai_message_router.cpp \
    src/ai_system_controller.cpp \
    src/ai_terminal.cpp \
    src/cbp2make_ai_complete.cpp \
    -L$WXWIN/lib/gcc_x64_dll \
    -lwxmsw32u_core -lwxbase32u \
    -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 \
    -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid \
    -lcomctl32 -lrpcrt4 -loleacc -luxtheme \
    -o cbp2make_ai_minimal.exe

if [[ $? -eq 0 ]]; then
    echo "✅ Minimal build successful!"
    ls -lh cbp2make_ai_minimal.exe
    echo "Testing..."
    ./cbp2make_ai_minimal.exe --ai-status
else
    echo "❌ Minimal build failed"
fi
